#!/bin/sh
#set -x

# (default) parameters
x=1

# take arguments as parameters n, m and the xth tester
#[ -n "$1" ] && n=$1
[ -n "$1" ] && x=$1

# other parameters
group=q_student
minutes=3
nodes=8
program=build/bin/mv"$x"
repetitions=20
#check=-c

for size in $(echo -n "300 600 1200 12000"); do
    rm -f results-mv"${x}"-"${size}";
    # parallel iterations
    for i in $(echo -n "1 16 32"); do
            # echo 
            echo "srun -p $group -t $minutes -N $nodes --ntasks-per-node=$i $program -n $size -r $repetitions $check; # distributed $nodes nodes with $i tasks per node" >> results-mv"${x}"-"${size}"
            srun -p "$group" -t "$minutes" -N "$nodes" --ntasks-per-node="$i" "$program" -n "$size" -r "$repetitions" "$check" >> results-mv"${x}"-"${size}";
    done;

    # sequential run
    echo "srun -p $group -t $minutes -N 1 --ntasks-per-node=1 $program -n $size -r $repetitions $check; # sequential run" >> results-mv"${x}"-"${size}"
    srun -p "$group" -t "$minutes" -N 1 --ntasks-per-node=1 "$program" -n "$size" -r "$repetitions" "$check" >> results-mv"${x}"-"${size}";
done;
